package pages;

import org.openqa.selenium.WebElement;

import io.appium.java_client.AppiumBy;
import io.appium.java_client.android.AndroidDriver;
import utiles.BaseAction;


public class MainPage {
	AndroidDriver driver;
	BaseAction action;
	public MainPage(AndroidDriver driver) {
		this.driver=driver;
		action=new BaseAction(driver);
	}
	
	public WebElement btn_personalInformation() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/person_data"));
	}
	
	public void edit_PersonalInformation() throws InterruptedException {
		action.click(this.btn_personalInformation());
	}
	
	public PersonPage editPersonalInformationSuccess() throws InterruptedException {
		edit_PersonalInformation();
		return new PersonPage(driver);
	}

	public WebElement btn_sport() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/sport_event"));	
	}
	
	public WebElement btn_foodie() {
		return driver.findElement(AppiumBy.id("njust.dzh.fitnesssystem:id/foodie_event"));	
	}
	
	public SportPage click_sport() throws InterruptedException {
		action.click(btn_sport());
		return new SportPage(driver);
	}
		
	public FoodiePage click_foodie() throws InterruptedException {
		action.click(btn_foodie());
		return new FoodiePage(driver);
	}
	
	
	
}
